<template>
	<view class="page-box">
		<view class="table-item-box" v-for="(item,index) in tableData" :key='index'>
			<view class="item-top-box">
				<text>{{item.memo}}</text>
				<text>{{item.money}}</text>
			</view>
			<view class="item-bottom-box">
				<text>{{item.createtime_text}}</text>
				<text>余额 {{item.after}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tableData:[],
				page:1
			}
		},
		onShow(){
			this.getList()
		},
		methods: {
			getList(){
				let params = {
					page:this.page
				}
				this.$http.post('api/user/getMoneyList',params).then((res)=>{
					console.log('res',res)
					if(this.page == 1){
						this.tableData = res.data.data
					}else{
						
					}
					uni.stopPullDownRefresh()
				}).catch((err)=>{
					
				})
			}
		},
		onPullDownRefresh(){
			this.page = 1
			this.getList()
		}
	}
</script>

<style>
	.page-box {
		width: 100%;
		height: 100%;
		overflow-y: scroll;
	}
	.table-item-box{
		margin-left: 16px;
		width: calc(100% - 32px);
		height: 74px;
		border-bottom: 1px solid #E5E5E5;
		padding: 14px 0px;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}
	.item-top-box{
		width: 100%;
		display: flex;
		justify-content: space-between;
		font-size: 16px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #010101;
	}
	.item-bottom-box{
		width: 100%;
		display: flex;
		justify-content: space-between;
		font-size: 12px;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #B5B5B5;
	}
</style>
